package com.cwh.taskcenter.user.gateway;

import com.cwh.taskcenter.domain.user.gateway.UserGateWay;
import com.cwh.taskcenter.domain.user.model.User;
import com.cwh.taskcenter.user.converter.UserConverter;
import com.cwh.taskcenter.user.mapper.UserMapper;
import com.cwh.taskcenter.user.model.UserDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author cwh
 */
@Service
public class UserGateWayImpl implements UserGateWay {

    @Autowired
    private UserMapper userMapper;


    @Override
    public User findById(Long id) {
        UserDO userDO = userMapper.findById(id);
        return UserConverter.toDomain(userDO);
    }
}
